package org.dtrd.modules.control.entity.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.dtrd.modules.control.entity.po.DtrdEntRdSigninTargetDetail;

@ApiModel("方案详情信息")
@Data
public class TargetDetailInfo {

    @ApiModelProperty("方案详情记录id")
    private Integer dataId;

    @ApiModelProperty("方案id")
    private Integer targetId;

    @ApiModelProperty(value = "患者id", required = true)
    private Integer patientId;

    @ApiModelProperty(value = "项目类型：1-体质指数（BMI）,2-糖化血红蛋白（HbA1c）,3-空腹血糖（FBG）,4-餐后血糖（PBG）,5-舒张压/低压,6-收缩压/高压,7-总胆固醇（TC）,8-甘油三酯（TG）,9- 高密度脂蛋白（HDL）,10-低密度脂蛋白（LDL）", required = true)
    private Integer projectType;

    @ApiModelProperty(value = "控制目标低值", required = true)
    private Float targetLow;

    @ApiModelProperty(value = "控制目标高值", required = true)
    private Float targetHigh;

    @ApiModelProperty(value = "当前值", required = true)
    private Float value;

    @ApiModelProperty("诊断结果")
    private String result;

    @ApiModelProperty(value = "单位", required = true)
    private String unit;

    @ApiModelProperty("用户类型")
    private Integer userType;

    public TargetDetailInfo parseFromPo(DtrdEntRdSigninTargetDetail po) {
        this.setDataId(po.getDataId());
        this.setTargetId(po.getTargetId());
        this.setPatientId(po.getPatientId());
        this.setProjectType(po.getProjectType());
        this.setTargetLow(po.getTargetLow());
        this.setTargetHigh(po.getTargetHigh());
        this.setValue(po.getValue());
        this.setResult(po.getResult());
        this.setUnit(po.getUnit());
        this.setUserType(po.getUserType());
        return this;
    }
}
